import request from '@/utils/request'

// 创建地区分类
export function createAreaCategory(data) {
  return request({
    url: '/market/area-category/create',
    method: 'post',
    data: data
  })
}

// 更新地区分类
export function updateAreaCategory(data) {
  return request({
    url: '/market/area-category/update',
    method: 'put',
    data: data
  })
}

// 删除地区分类
export function deleteAreaCategory(id) {
  return request({
    url: '/market/area-category/delete?id=' + id,
    method: 'delete'
  })
}

// 获得地区分类
export function getAreaCategory(id) {
  return request({
    url: '/market/area-category/get?id=' + id,
    method: 'get'
  })
}

// 获得地区分类分页
export function getAreaCategoryPage(params) {
  return request({
    url: '/market/area-category/page',
    method: 'get',
    params
  })
}
export function getAreaCategoryList() {
  return request({
    url: '/market/area-category/list',
    method: 'get',
  })
}
// 导出地区分类 Excel
export function exportAreaCategoryExcel(params) {
  return request({
    url: '/market/area-category/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
